package com.ruoyi.psi.inventory.transfer.mapper;

import com.ruoyi.psi.base.product.domain.ProduceCheck;
import com.ruoyi.psi.inventory.transfer.domain.InventoryTransfer;
import com.ruoyi.psi.inventory.transfer.domain.InventoryTransferList;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 产品库存调拨
 * 数据层
 */
public interface InventoryTransferMapper {
    /**
     * 仓库调拨查询
     * @param inventoryTransfer
     * @return
     */
    public List<InventoryTransfer> selectInventoryTransferList(InventoryTransfer inventoryTransfer);

    /**
     * 获取最新的一条库存调拨编号
     * @return
     */
    public String getInventoryTransferId();

    /**
     * 按编号查询
     * @param inventoryTransferId 仓库调拨编号
     * @return
     */
    public InventoryTransfer selectInventoryTransferById(String inventoryTransferId);
    /**
     * 仓库调拨新增
     * @param inventoryTransfer
     * @return
     */
    public int insertInventoryTransfer(InventoryTransfer inventoryTransfer);

    /**
     * 仓库调拨更新
     * @param inventoryTransfer
     * @return
     */
    public int updateInventoryTransfer(InventoryTransfer inventoryTransfer);

    /**
     * 更新仓库调拨删除标志位
     * @param inventoryTransfer
     * @return
     */
    public int updateInventoryTransferDeleteFlag(InventoryTransfer inventoryTransfer);

    /**
     * 仓库调拨详细查询
     * @param inventoryTransferList
     * @return
     */
    public List<InventoryTransferList> selectInventoryTransferListList(InventoryTransferList inventoryTransferList);

    /**
     * 查询仓库调拨对应的所有产品详细
     * @param inventoryTransferId 仓库调拨编号
     * @return
     */
    public List<InventoryTransferList> selectInventoryTransferListListById(String inventoryTransferId);

    /**
     * 查询仓库调拨对应的指定产品详细
     * @param inventoryTransferId
     * @return
     */
    public InventoryTransferList  selectInventoryTransferListById(@Param("inventoryTransferId")String inventoryTransferId, @Param("produceId")String produceId);

    /**
     * 仓库调拨详细新增
     * @param inventoryTransferList
     * @return
     */
    public int insertInventoryTransferList(InventoryTransferList inventoryTransferList);

    /**
     * 仓库调拨详细更新
     * @param inventoryTransferList
     * @return
     */
    public int updateInventoryTransferList(InventoryTransferList inventoryTransferList);

    /**
     * 删除仓库调拨详细
     * @param inventoryTransferId  仓库调拨编号
     * @param produceId 产品编号
     * @return
     */
    public int deleteInventoryTransferListById(@Param("inventoryTransferId")String inventoryTransferId, @Param("produceId")String produceId);

    /**
     * 获取指定产品调拨出库数量
     * @param produceCheck
     * @return
     */
    public Double getTransferOutProduceNum(ProduceCheck produceCheck);

    /**
     * 获取指定产品调拨入库数量
     * @param produceCheck
     * @return
     */
    public Double getTransferInProduceNum(ProduceCheck produceCheck);
}
